﻿#ifndef PROJECTMODEL_H
#define PROJECTMODEL_H


#include "DataView_global.h"

namespace xvs {



class DATAVIEW_EXPORT TaskModel : public QAbstractItemModel
{
    Q_OBJECT

public:
    void SetTaskObj(TaskObj* taskobj);

    InstObj* ObjFromIndex(QModelIndex index);

    QModelIndex IndexFromObj(InstObj* obj);

    void BeginInsertRows(int first,int last = 0);
    void EndInsertRows();

    void BeginRemoveRows(int first,int last = 0);
    void EndRemoveRows();

public:
//    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
    QModelIndex index(int row, int column, const QModelIndex &parent) const override;
    QModelIndex parent(const QModelIndex &child) const override;
    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    int columnCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

private:
    TaskObj* mTaskObj = nullptr;
};


}

#endif // PROJECTMODEL_H
